package com.easpeed.elevator.ui;

import static com.easpeed.comon.utils.KotlinextralKt.isUser;
import static com.easpeed.comon.utils.TcpDataKt.decompressData;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.DashPathEffect;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.text.TextUtils;

import com.bigyu.utils.Logger;

import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.MotionEvent;
import android.view.ScaleGestureDetector;
import android.view.View;
import android.widget.EditText;
import android.widget.LinearLayout;
import android.widget.RadioGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import com.blankj.utilcode.util.ClipboardUtils;
import com.blankj.utilcode.util.ScreenUtils;
import com.blankj.utilcode.util.ToastUtils;
import com.easpeed.common.CommonConsts;
import com.easpeed.comon.bean.ChartControlBean;
import com.easpeed.comon.bean.HighlightBean;
import com.easpeed.comon.bean.LineChartExpand;
import com.easpeed.comon.bean.OtdrBean;
import com.easpeed.comon.bean.BtnStatusBean;
import com.easpeed.comon.bean.OtdrOriangeBean;
import com.easpeed.comon.bean.SsxfBean;
import com.easpeed.comon.consts.ChannelConsts;
import com.easpeed.comon.consts.ConstsOpticalData;
import com.easpeed.comon.consts.CustomSetting;
import com.easpeed.comon.dialog.RouteListDialog;
import com.easpeed.comon.utils.CommandReceiveData;
import com.easpeed.comon.utils.LocationHelper;
import com.easpeed.comon.utils.SendCommand;
import com.easpeed.comon.utils.SocketHelper;
import com.easpeed.comon.utils.TcpData;
import com.easpeed.elevator.BuildConfig;
import com.easpeed.elevator.R;
import com.easpeed.elevator.base.BaseActivity;
import com.easpeed.elevator.bean.EventInfo;
import com.easpeed.elevator.bean.RouteBean;
import com.easpeed.elevator.event.GetSerialMessageEvent;
import com.easpeed.elevator.event.SendOrderEvent;
import com.easpeed.elevator.otdr.ISerSender;
import com.easpeed.elevator.otdr.OTDRDataProcessor;
import com.easpeed.elevator.otdr.OtdrController;
import com.easpeed.elevator.serialport2.SerialPortManager2;
import com.easpeed.elevator.udp.UdpTool;
import com.easpeed.elevator.utils.ByteUtil;
import com.easpeed.elevator.utils.ChartUtil;
import com.easpeed.elevator.utils.NoticeDialog;
import com.easpeed.elevator.utils.OpticalTestHelper;
import com.easpeed.elevator.utils.OpticalViewHolder;
import com.easpeed.elevator.utils.WwViewHolder;
import com.github.mikephil.charting.charts.LineChart;
import com.github.mikephil.charting.components.Legend;
import com.github.mikephil.charting.components.LimitLine;
import com.github.mikephil.charting.components.XAxis;
import com.github.mikephil.charting.components.YAxis;
import com.github.mikephil.charting.data.Entry;
import com.github.mikephil.charting.data.LineData;
import com.github.mikephil.charting.data.LineDataSet;
import com.github.mikephil.charting.highlight.Highlight;
import com.github.mikephil.charting.listener.ChartTouchListener;
import com.github.mikephil.charting.listener.OnChartGestureListener;
import com.github.mikephil.charting.listener.OnChartValueSelectedListener;
import com.github.mikephil.charting.utils.MPPointD;
import com.github.mikephil.charting.utils.ViewPortHandler;
import com.google.gson.Gson;
import com.gyf.immersionbar.BarHide;
import com.gyf.immersionbar.ImmersionBar;

import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import butterknife.ButterKnife;
import kotlin.Unit;
import kotlin.jvm.functions.Function1;
import kotlin.text.Charsets;


public class OpticTestingActivity extends BaseActivity implements ISerSender {

    boolean isDebugData = false;

    private String TAG = "OpticTestingActivity";
    private Context mContext;

    Bitmap waterfallChartBitmap;

    private String mDevicename2 = "/dev/ttyS3";//串口名字

    private OtdrController oc = new OtdrController();
    private long OTDR_DELAY = 20000; // 两次点击的最小间隔时间

    //所有点位
    ArrayList<int[]> allDvsData = new ArrayList<int[]>();

    UdpTool udpTool;
    ArrayList<String> order = new ArrayList<>();
    ArrayList<String> serorder = new ArrayList<>();

    private boolean runningState = false;
    private boolean firstDataArrive = false;
    private boolean otdrVisible = true;

    private boolean enableRX = false;// 是否开启实时寻峰
    private boolean enableYH = false;//是否开启了余晖
    private boolean enableFilter = true; //是否开启了滤波


    private LocationHelper locationHelper;


    //当前选中的采集范围
//    private String currentCjfw = "10000";
//    private String currentCssj = "5";
    //当前选中的脉冲宽度 otdr
//    private String currentMcsj = "100";
//    private String currentMcsjDvs = "100";
//    private String currentLb = "100";
    //otdr 折射率
    private float currentZsl = 1.467f;
    //dvs 折射率
    private float currentDVSZsl = 1.467f;
    //事件阈值
//    private int currentSjyz = 100;
    //抛点距离
    private int currentPdjl = 70;

    // 选中的通道下标
    private int currentChannel = 0;
    private String channelName = "通道1";
    //事件列表的数据
    private ArrayList<EventInfo> eventInfoList = new ArrayList<>();
    private float mEndEventStartDistance = -1f;

    WwViewHolder holder;

    private OpticalTestHelper mOpticalTestHelper;


    //    @BindView(R.id.line1)
    LineChart mChart;
    //    @BindView(R.id.arrowImageView)
    ArrowImageView mArrow;
    //    @BindView(R.id.imagewater)
    WaterfallView imagewater;
    //    @BindView(R.id.imagewater_layout)
    View imagewaterLayout;
    //    @BindView(R.id.intensity_chart)
    IntensityView intensityChart;

    public static void start(Context context, Bundle bundle) {
        Intent intent = new Intent();
        intent.setClass(context, OpticTestingActivity.class);
        intent.putExtras(bundle);
        context.startActivity(intent);
    }

    @Override
    protected void getIntentData(Bundle savedInstanceState) {
    }


    @Override
    protected void loadXml() {
        try {
            currentChannel = getIntent().getIntExtra("channelIndex", 0);
            currentDVSZsl = Float.parseFloat(getIntent().getStringExtra("dvsZsl"));
            currentZsl = Float.parseFloat(getIntent().getStringExtra("otdrZsl"));
            currentPdjl = Integer.parseInt(getIntent().getStringExtra("pdjl"));
            Logger.e(TAG, "currentDVSZsl:" + currentDVSZsl + " currentZsl:" + currentZsl + " currentPdjl:" + currentPdjl);
        } catch (Exception e) {

        }
        ChannelConsts.changeDvsChannel("" + currentChannel);


        isDestroy = false;
        locationHelper = new LocationHelper();
        locationHelper.init(this);
        ImmersionBar.with(this).fullScreen(true).hideBar(BarHide.FLAG_HIDE_BAR).init();
        mContext = this;
        setContentView(R.layout.activity_optic_testing_v2);
        ButterKnife.bind(this);
        EventBus.getDefault().register(this);

        mOpticalTestHelper = new OpticalTestHelper(this);
        OpticalViewHolder opticalViewHolder = new OpticalViewHolder();
        opticalViewHolder.setWayView(findViewById(R.id.way));
        opticalViewHolder.setYhView(findViewById(R.id.yuhui));
        opticalViewHolder.setOtdrView(findViewById(R.id.otdr_start));

        opticalViewHolder.setOtdrTimeView(findViewById(R.id.shijianbiao));
        opticalViewHolder.setAutoPeakView(findViewById(R.id.shishixunfeng));
        opticalViewHolder.setManualPeakView(findViewById(R.id.xunfeng));

        opticalViewHolder.setSinglePointTimeView(findViewById(R.id.single_chart));
        opticalViewHolder.setSettingView(findViewById(R.id.setting));

        opticalViewHolder.setOtdrRangeDataView(findViewById(R.id.otdr_data_range));
        opticalViewHolder.setOtdrWidthDataView(findViewById(R.id.otdr_data_width));
        opticalViewHolder.setOtdrTimeDataView(findViewById(R.id.otdr_data_time));
        opticalViewHolder.setOtdrHideView(findViewById(R.id.xian));

        opticalViewHolder.setDvsDataView(findViewById(R.id.lb));
        opticalViewHolder.setDvsWidthDataView(findViewById(R.id.mk));
        opticalViewHolder.setDvsThresholdDataView(findViewById(R.id.yuzhi));

        opticalViewHolder.setLayoutSinglePointTimeView(findViewById(R.id.single_chart_layout));
        mOpticalTestHelper.setHolder(opticalViewHolder);
        mOpticalTestHelper.saveCallBack(() -> {
            clickSave();
            return null;
        });

        ToastUtils.showShort("进入光缆检测页面");
        holder = new WwViewHolder(this, this.getWindow().getDecorView());
        mChart = holder.getView(R.id.line1);
        mArrow = holder.getView(R.id.arrowImageView);
        imagewater = holder.getView(R.id.imagewater);
        imagewaterLayout = holder.getView(R.id.imagewater_layout);
        intensityChart = holder.getView(R.id.intensity_chart);
        initDevice();

        initWaterfallChart();

//        holder.setActivated(R.id.filter_start, !enableFilter);
        holder.setActivated(R.id.yuhui, true);
        holder.setActivated(R.id.shishixunfeng, true);
        holder.setActivated(R.id.xian, true);

        if (!isUser()) {
            SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.changeDvsStateCommand), CommandReceiveData.commandToStr(CommandReceiveData.openState));
        } else {
            SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.changeDvsStateCommand), CommandReceiveData.commandToStr(CommandReceiveData.openState));

            SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandDvsDataRequest), "");
        }
//        if (BuildConfig.DEBUG && isUser()) {
//            SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandDvsDataRequest), "");
//        }

        if (BuildConfig.DEBUG && !isUser()) {
            String json = "[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,48,22,0,61,132,135,90,0,0,32,0,0,0,0,0,0,0,0,47,0,0,0,0,0,0,0,0,0,24,0,0,0,0,0,0,1,0,0,8,0,0,2,0,0,0,0,0,0,0,0,0,3,0,0,0,0,26,0,0,0,0,0,0,24,0,0,0,0,0,4,0,0,0,0,0,0,0,0,0,0,2,0,6,0,0,0,0,0,20,0,0,0,0,11,0,2,0,19,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0,0,13,22,20,22,0,0,0,0,2,0,3,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,3,0,2,11,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,17,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,16,0,0,0,0,0,0,0,0,0,0,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0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]";


            int[] parsedDataDvs = new Gson().fromJson(json, int[].class);
            Logger.e(TAG, "loadXml: " + parsedDataDvs.length);
            lastDvsData = new SendOrderEvent(parsedDataDvs);
            processDvsData(lastDvsData);
            new Handler().postDelayed(new Runnable() {
                @Override
                public void run() {
//                    14353.313  30.0
//                    mChart.highlightValue(14353.313f, 30.0f, 0);
                }
            }, 2000);
        }
    }

    public void fillIntensityChart(float distancePoint, boolean fullRedraw) {
        if (allDvsData == null) return;

        //距离点转化成 0-20000(3/1.467*20000)
        int number = (int) Math.floor(ChartUtil.dvsXToIndex(distancePoint));
        if (number < 0) {
            number = 0;
        }
        int[] intensity = new int[ChartUtil.fixedHeight];
        for (int index = 0; index < ChartUtil.fixedHeight; index++) {
            if (index < allDvsData.size() && allDvsData.get(index) != null) {
                int[] row = allDvsData.get(allDvsData.size() - index - 1);
                if (number < row.length) {
                    intensity[index] = row[number];
                }
                //本次光纤没有该距离
                else {
                    intensity[index] = -1;
                }
            } else {
                intensity[index] = -1;
            }
        }
        Bitmap bitmap = ChartUtil.newIntensityBitmap(intensity);

        intensityChart.setBitmap(bitmap, (int) touchpoint + "米");
    }


    //初始化瀑布图片
    public void initWaterfallChart() {
        //sheng
        waterfallChartBitmap = ChartUtil.initWaterfallBitmap();
        imagewater.setBitmap(waterfallChartBitmap);
    }

    //填充瀑布流数据
    public void fillWaterfallChart(int[] dvs) {
        imagewater.addDvs(dvs);
        SaveAllDvsData(dvs);
    }

    //保存所有点位
    public void SaveAllDvsData(int[] dvs) {
        //如果大于定义的最大数量
        if (allDvsData.size() > ChartUtil.fixedHeight) {
            allDvsData.remove(0);
        }
        allDvsData.add(dvs);
    }

    // 记录上一次点击的时间
    long lastClickTime = 0;
    public OTDRDataProcessor processor = new OTDRDataProcessor();

    @Override
    protected void initData() {
        String currentCjfw = ConstsOpticalData.dataCjfw.get(6);
        String currentMcsj = ConstsOpticalData.getMckdData(currentCjfw).get(0);
        channelName = getIntent().getStringExtra("channelName");


        holder.setText(R.id.way, channelName);


        mOpticalTestHelper.setDvsData(Integer.parseInt(mOpticalTestHelper.getCurrentSjzu()) + "", mOpticalTestHelper.getCurrentLb(), mOpticalTestHelper.getCurrentMcsjDvs());
        mOpticalTestHelper.setOtdrData(currentCjfw, currentMcsj, mOpticalTestHelper.getCurrentCssj(), mOpticalTestHelper.getCurrentBc());


//        if (CustomSetting.getAddTestCsfw()) {
//            mChart.getXAxis().setAxisMaximum(Integer.parseInt(mOpticalTestHelper.getCurrentCjfw()));
//            mChart.notifyDataSetChanged();
//            mChart.invalidate();
//        }

        udpTool.setModel(mOpticalTestHelper.getCurrentLb());
        //设备端需要自己设置OTDR参数
        oc.setOtdrSetWithBc(Integer.parseInt(mOpticalTestHelper.getCurrentCjfw()), Integer.parseInt(mOpticalTestHelper.getCurrentMckd()), Integer.parseInt(mOpticalTestHelper.getCurrentCssj()), currentZsl, ConstsOpticalData.getDefaultBc());

    }

    @Override
    protected void initView() {
        initChat();
        udpTool = UdpTool.getInstance(this);

        runningState = true;
        SwitchDVSModel(true);


        //监听用户端的数据
        SocketHelper.addResultListener(getClass().getSimpleName(), new Function1<TcpData, Unit>() {
            @Override
            public Unit invoke(TcpData tcpData) {
                String commandStr = tcpData.getCommandStr();
                String appType = "";
                if (tcpData.getData() != null) {
                    appType = tcpData.getData().getAppType();
                }
                //是否开关DVS命令
                if (TextUtils.equals(commandStr, SendCommand.commandToStr(SendCommand.changeDvsStateCommand))) {
                    String state = tcpData.getBundleStr();
                    if (appType.equals("01")) {
                        //01 设备 02 APP
                        devRequestHandler.removeCallbacksAndMessages(null);
                        if (state.equals(CommandReceiveData.commandToStr(CommandReceiveData.openState))) {
                            holder.setActivated(R.id.way, false);
                            runningState = true;
                            devRequestHandler.sendEmptyMessage(0);
                        } else {
                            runningState = false;
                            holder.setActivated(R.id.way, true);
                        }
                    } else {
                        //这是设备端要做的事情
                        if (state.equals(CommandReceiveData.commandToStr(CommandReceiveData.openState))) {
                            if (!runningState && holder.getActivated(R.id.way)) {
                                holder.getView(R.id.way).performClick();
                            }
                        } else {
                            if (runningState && !holder.getActivated(R.id.way)) {
                                holder.getView(R.id.way).performClick();
                            }
                        }
                    }
                } else if (TextUtils.equals(commandStr, SendCommand.commandToStr(SendCommand.commandEventTable))) {
                    //设备端收到表示需要发送事件表数据给用户端
                    if (appType.equals("01")) {
                        //01 设备 02 APP
                        //收到事件表数据，更新本地数据
                        try {
                            ArrayList<EventInfo> infoArrayList = (ArrayList<EventInfo>) tcpData.getAny();
                            eventInfoList.clear();
                            eventInfoList.addAll(infoArrayList);
                            showEventList(eventInfoList);
                        } catch (Exception e) {
                            e.printStackTrace();
                        }
                    } else {
                        //需要吧自己的事件表数据传过去
                        String eventTableJson = new Gson().toJson(eventInfoList);
                        SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandEventTable), eventTableJson);
                    }
                } else if (TextUtils.equals(commandStr, SendCommand.commandToStr(SendCommand.commandOTDRDataRequest))) {
                    //收到请求，需要otdr数据
                    try {
                        OtdrBean otdrBean = (OtdrBean) tcpData.getAny();
                        if (otdrBean.isDefaultSent()) {
                            realOtdrStart(true);
                        } else {
                            realOtdrCustomStart(otdrBean);
                        }
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } else if (TextUtils.equals(commandStr, SendCommand.commandToStr(SendCommand.commandOTDRDataResponse))) {
                    //处理otdr数据
                    //01 设备 02 APP , 收到设备端发来的数据

                    executorParseOtdrData.submit(new Runnable() {

                        @Override
                        public void run() {
                            try {
                                Logger.e("TAG", "invoke:11111111111111111111111111111 ");
//                        ArrayList<double[]> infoArrayList = (ArrayList<double[]>) tcpData.getAny();
//                        OnOTDRData(infoArrayList);
                                long start = System.currentTimeMillis();
                                byte[] dataBytes = tcpData.getData().getDataBytes();
                                byte[] bytes = decompressData(dataBytes);
                                String data = new String(bytes, Charsets.UTF_8);
                                Logger.e("TAG", "解压后数据长度: " + bytes.length + ",原始数据长度: " + dataBytes.length + " ,命令" + tcpData.getCommandStr() + ",解压时间 " + (System.currentTimeMillis() - start));
                                OtdrOriangeBean parsedDataDvs = new Gson().fromJson(data, OtdrOriangeBean.class);
                                List<double[]> doubles = processor.dataProcessing(0, null, parsedDataDvs.getMlsj(), parsedDataDvs.getPointDistance(), parsedDataDvs.getMaxDistance());
//                                Logger.e("TAG", "====="+doubles);
                                OnOTDRData(doubles);
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                        }
                    });

                } else if (TextUtils.equals(commandStr, SendCommand.commandToStr(SendCommand.commandDvsDataRequest))) {
                    //收到请求，需要DVS数据
                    //服务端发送DVS数据
                    String json = "";
                    try {
                        int[] dataDvs = lastDvsData.getDvs();
                        json = new Gson().toJson(dataDvs);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                    SocketHelper.sendCommand(SendCommand.commandDvsDataResponse, json);
                } else if (TextUtils.equals(commandStr, SendCommand.commandToStr(SendCommand.commandDvsDataResponse))) {
                    //收到设备端的DVS数据
                    try {
                        if (!holder.getActivated(R.id.way)) {
                            long delay = 250;
                            long offset = System.currentTimeMillis() - lastUserRequestDvsTime;
                            if (offset > 250) {
                                delay = 0;
                            } else {
                                delay = 250 - offset;
                            }
                            devRequestHandler.removeCallbacksAndMessages(null);
                            devRequestHandler.sendEmptyMessageDelayed(0, delay);
                        }

                        executorParseDvsData.submit(() -> {
                            try {
                                long start = System.currentTimeMillis();
                                byte[] dataBytes = tcpData.getData().getDataBytes();
                                byte[] bytes = decompressData(dataBytes);
                                String data = new String(bytes, Charsets.UTF_8);
                                Logger.e("TAG", "解压后数据长度: " + bytes.length + ",原始数据长度: " + dataBytes.length + " ,命令" + tcpData.getCommandStr() + ",解压时间 " + (System.currentTimeMillis() - start));
                                int[] parsedDataDvs = new Gson().fromJson(data, int[].class);
                                runOnUiThread(new Runnable() {
                                    @Override
                                    public void run() {
                                        if (isDestroy) {
                                            return;
                                        }
                                        processDvsData(new SendOrderEvent(parsedDataDvs));
                                    }
                                });
                            } catch (Exception e) {
                                e.printStackTrace();
                            }
                        });

                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } else if (TextUtils.equals(commandStr, SendCommand.commandToStr(SendCommand.commandSsxfResponseOperate))) {
                    //用户收到通知需要进行实时寻峰的数据
                    if (isUser()) {
                        try {
                            SsxfBean bean = (SsxfBean) tcpData.getAny();
                            mEndEventStartDistance = bean.getMEndEventStartDistance();
                        } catch (Exception e) {

                        }
                    }
                } else if (TextUtils.equals(commandStr, SendCommand.commandToStr(SendCommand.commandMatrixResponse))) {
                    try {
                        if (!isUser()) {
                            ChartControlBean bean = (ChartControlBean) tcpData.getAny();
                            float visibleRange = bean.getEndX() - bean.getStartX();
                            mChart.resetZoom();
                            mChart.setVisibleXRange(visibleRange, visibleRange);

                            float visibleHeight = bean.getStartY() - bean.getEndY();
                            mChart.setVisibleYRange(visibleHeight, visibleHeight, YAxis.AxisDependency.LEFT);
                            mChart.moveViewTo(bean.getStartX(), (bean.getStartY() + bean.getEndY()) / 2, YAxis.AxisDependency.LEFT);
                            mChart.invalidate();
                            Logger.e(TAG, "invoke:   " + bean.getStartY() + "  " + bean.getEndY());
                            isUserOperateLine = true;
                        }

                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } else if (TextUtils.equals(commandStr, SendCommand.commandToStr(SendCommand.commandExpandResponse))) {
                    try {
                        LineChartExpand bean = (LineChartExpand) tcpData.getAny();
                        realSetBitmap(bean.getX1(), bean.getX2());
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } else if (TextUtils.equals(commandStr, SendCommand.commandToStr(SendCommand.commandSyncHideOtdrData))) {
                    try {
                        BtnStatusBean bean = (BtnStatusBean) tcpData.getAny();
                        otdrVisible = bean.isHide();
                        hideOtdr(true);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } else if (TextUtils.equals(commandStr, SendCommand.commandToStr(SendCommand.commandSyncYuhuiData))) {
                    try {
                        BtnStatusBean bean = (BtnStatusBean) tcpData.getAny();
                        enableYH = bean.isHide();
                        yuhui(true);
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                } else if (TextUtils.equals(commandStr, SendCommand.commandToStr(SendCommand.commandSyncLineData))) {
                    try {
                        HighlightBean bean = (HighlightBean) tcpData.getAny();
                        if (lastServerHighlightBean != bean) {
                            mChart.highlightValue(bean.getX(), bean.getY(), bean.getIdnex());
                        }
                        lastServerHighlightBean = bean;
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }
                return null;
            }
        });
    }

    private HighlightBean lastServerHighlightBean;

    private boolean isUserOperateLine = false;

    private boolean isFirst = true;


    public void SwitchDVSModel(boolean isStart) {
        if (enableFilter) {
            SwitchFilterDVS(isStart);
        } else {
            SwitchNormalDVS(isStart);
        }
    }

    public void SwitchNormalDVS(boolean isStart) {
        String head = "A55AAA5555AA";

        String order1 = "00010002000000080000000000000000" + CustomSetting.getDvsDistance();
        String order2 = "000100220000000800000000000000000004";
        String order3 = "0001000400000008000000000000000003E8";
        String order4 = "0001001100000008000000000000" + to8BitHexString(mOpticalTestHelper.getCurrentMcsjDvs()); //脉冲宽度
        String order5 = "000100100000000800000000000000000000";
        String order6 = "000100200000000800000000000000000040";
        String order7 = "000100080000000800000000000000000000";
        String order8 = "000100210000000800000000000000000001";
        String order9 = "000100230000000800000000000000000410";
        String order10 = "000100010000000800000000000000000000";
        String order11 = "000100080000000800000000000000000001";
        ArrayList<String> tempOrder = order;
        tempOrder.clear();
        tempOrder.add(head + order1);
        tempOrder.add(head + order2);
        tempOrder.add(head + order3);
        tempOrder.add(head + order4);
        tempOrder.add(head + order5);
        tempOrder.add(head + order6);
        tempOrder.add(head + order7);
        tempOrder.add(head + order8);
        tempOrder.add(head + order9);
        tempOrder.add(head + order10);
        tempOrder.add(head + order11);
        if (isStart) {
            tempOrder.add(head + getorder);
        }

        udpTool.DisableFriFilters();
        handler.sendEmptyMessageDelayed(0, 5000);
    }

    public void SwitchFilterDVS(boolean isStart) {
        String order1 = "000100220000000800000000000000000004";
        String order2 = "00010002000000080000000000000000" + CustomSetting.getDvsDistance();
        String order3 = "0001000400000008000000000000000003e8";
        String order4 = "0001001100000008000000000000" + to8BitHexString(mOpticalTestHelper.getCurrentMcsjDvs()); //脉冲宽度
        String order5 = "000100100000000800000000000000000000";
        String order6 = "000100080000000800000000000000000000";
        String order7 = "000100200000000800000000000000000004";
        String order8 = "000100210000000800000000000000000000";
        String order9 = "000100230000000800000000000000000410";
        String order10 = "000100010000000800000000000000000001";
        ArrayList<String> tempOrder = order;
        tempOrder.clear();
        tempOrder.add(head + order1);
        tempOrder.add(head + order2);
        tempOrder.add(head + order3);
        tempOrder.add(head + order4);
        tempOrder.add(head + order5);
        tempOrder.add(head + order6);
        tempOrder.add(head + order7);
        tempOrder.add(head + order8);
        tempOrder.add(head + order9);
        if (isStart) {
            tempOrder.add(head + order10);
            tempOrder.add(head + getorder);
        }

        udpTool.EnableFriFilters();
        handler.sendEmptyMessageDelayed(0, 5000);
    }

    public static String to8BitHexString(String intString) {
        // 使用String.format()方法将整数格式化为8位的十六进制字符串，前面用0填充
        int number = Integer.parseInt(intString);
        return String.format("%08X", number); // %08X 表示宽度为8，用0填充，大写十六进制
    }


    private long lastUserRequestDvsTime = 0;
    //定时获取DVS数据
    private Handler devRequestHandler = new Handler(new Handler.Callback() {

        @Override
        public boolean handleMessage(Message msg) {
            lastUserRequestDvsTime = System.currentTimeMillis();
            SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandDvsDataRequest), "");
            return false;
        }
    });

    public void stopDVS(boolean fromServer) {
        if (isUser()) {
            devRequestHandler.removeCallbacksAndMessages(null);
            SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.changeDvsStateCommand), CommandReceiveData.commandToStr(CommandReceiveData.closeState));
        } else {
            holder.setActivated(R.id.way, true);
            runningState = false;
            udpTool.sendMessage(head + cancelorder);
            if (!fromServer) {
                SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.changeDvsStateCommand), CommandReceiveData.commandToStr(CommandReceiveData.closeState));
            }
        }
    }

    public void startDVS(boolean fromServer) {
        if (isUser()) {
            SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.changeDvsStateCommand), CommandReceiveData.commandToStr(CommandReceiveData.openState));
            devRequestHandler.removeCallbacksAndMessages(null);
            devRequestHandler.sendEmptyMessage(0);
        } else {
            ChannelConsts.changeDvsChannel(currentChannel + "");
            //如果是设备端，串口发送指令
            udpTool.sendMessage(head + getorder);
            if (!fromServer) {
                SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.changeDvsStateCommand), CommandReceiveData.commandToStr(CommandReceiveData.openState));
            }
        }
    }

    private boolean isDestroy = false;

    @Override
    protected void onDestroy() {
        isDestroy = true;
        super.onDestroy();
        if (!isUser()) {
            SocketHelper.sendCommand(SendCommand.commandResponse, "设备端退出光缆页面!");
        }
        locationHelper.release();
        locationHelper.stop();
        SocketHelper.removeResultListener(getClass().getSimpleName());
        ChartUtil.lambd = 1.467f;
        ChartUtil.dividingColorValue = 100;
        ChartUtil.pdjl = 70;
        stopDVS(false);
        EventBus.getDefault().unregister(this);
        devRequestHandler.removeCallbacksAndMessages(null);
        handler.removeCallbacksAndMessages(null);

        executorParseDvsData.shutdown();
        executorParseOtdrData.shutdown();
//        SerialPortManager.instance().close();
//        SerialPortManager2.instance().close();
//        udpTool.closeSocket();

    }


    String head = "A55AAA5555AA";

    String getorder = "000100010000000800000000000000000001";
    //    String getorder = "000200020000000800000000000000000000";
    String cancelorder = "000100010000000800000000000000000000";

    Handler handler = new Handler(new Handler.Callback() {
        @Override
        public boolean handleMessage(Message msg) {

            if (msg.what < order.size()) {
                udpTool.sendMessage(order.get(msg.what));
                handler.sendEmptyMessageDelayed(msg.what + 1, 100);
            } else {
                handler.removeCallbacksAndMessages(null);
            }
            return false;
        }
    });


    private boolean isTouchChart = false;
    int s2 = 40000;

    private void setBitmap() {
        LineChart tempChart = mChart;

        double s1 = (tempChart.getLowestVisibleX() / tempChart.getXRange());
        double s2 = (tempChart.getHighestVisibleX() / tempChart.getXRange());
//        Logger.d("sheng", "onChartGestureEnd" +  + "---" + );
        Logger.e("oye", "onChartGestureEnd" + s1 + "---" + s2);
        int lowestVisibleX = (int) tempChart.getLowestVisibleX();
        int highestVisibleX = (int) tempChart.getHighestVisibleX();

        realSetBitmap(lowestVisibleX, highestVisibleX);
        if (isUser()) {
            SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandExpandResponse), new Gson().toJson(new LineChartExpand(lowestVisibleX, highestVisibleX)));
        }
    }

    private void realSetBitmap(int lowestVisibleX, int highestVisibleX) {
        if (BuildConfig.DEBUG) {
            Logger.e(TAG, "realSetBitmap: " + lowestVisibleX + "  " + highestVisibleX);
        }
        this.imagewater.setExpand(lowestVisibleX, highestVisibleX);
        this.imagewater.invalidate();
    }

    private void setExpand() {
        LineChart tempChart = mChart;
        int lowestVisibleX = (int) tempChart.getLowestVisibleX();
        int highestVisibleX = (int) tempChart.getHighestVisibleX();
        realSetBitmap(lowestVisibleX, highestVisibleX);
    }

    float touchpoint = 3000;


    boolean isFirstDraw = true;

    //通过UDP刷新图表数据
    private void notifyDataChanged(SendOrderEvent str) {
        Logger.d("optA", "start refresh");
        LineChart tempChart = mChart;
        firstDataArrive = true;
        preDvsData = lastDvsData;

        lastDvsData = str;
        refreshData();
        if (touchpoint != 0) {
            fillIntensityChart(touchpoint, false);
        }

        if (isFirstDraw) {
            isFirstDraw = false;
            runOnUiThread(() -> {
                // 设置监听器
                setExpand();

                float chartLeftDis = tempChart.getViewPortHandler().offsetLeft();
                float chartRightDis = tempChart.getViewPortHandler().offsetRight();
                imagewaterLayout.setPadding((int) chartLeftDis, 0, (int) chartRightDis, 0);
                Logger.e("TAG", "瀑布对齐===>" + chartLeftDis + "  " + chartRightDis);

                View backBtn = findViewById(R.id.back);
                LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) backBtn.getLayoutParams();
                params.leftMargin = (int) chartLeftDis;
                backBtn.setLayoutParams(params);


                RelativeLayout.LayoutParams arrowLayoutParams = (RelativeLayout.LayoutParams) mArrow.getLayoutParams();
                arrowLayoutParams.leftMargin = (int) chartLeftDis;
                arrowLayoutParams.rightMargin = (int) chartRightDis;
                mArrow.setLayoutParams(arrowLayoutParams);
            });
        }
        //从X轴进入的动画
//        tempChart.animateX(2000);
//        tempChart.animateY(2000);   //从Y轴进入的动画
//        tempChart.animateXY(100, 100);    //从XY轴一起进入的动画

        //设置最小的缩放
        tempChart.setScaleMinima(0.5f, 1f);
        //设置视口
        // tempChart.centerViewPort(10, 50);

        // get the legend (only possible after setting data)
        Legend l = tempChart.getLegend();
        l.setEnabled(false);
//        l.setForm(Legend.LegendForm.CIRCLE);  //设置图最下面显示的类型
//        l.setTextSize(30);
//        l.setTextColor(Color.rgb(244, 117, 117));
//        l.setDirection(Legend.LegendDirection.RIGHT_TO_LEFT);
//        l.setYOffset(100);
//        l.setFormSize(10f); // set the size of the legend forms/shapes

        tempChart.setDrawGridBackground(false);
        // 刷新图表
        invalidateLineChart();

        Logger.d("optA", "end refresh");

//        //下面用于确定刷新数据后的坐标轴位置，因为已经硬编码了可以关掉，后面调整布局可以重新获取
//// 获取 LineChart 的位置
//        int[] location = new int[2];
//        tempChart.getLocationOnScreen(location);
//
//// 获取可视区域的宽度
//        int chartWidth = tempChart.getWidth();
//
//// 计算 X 轴的边距
//        float xOffset = tempChart.getXAxis().getXOffset();
//        float fOffset = tempChart.getRendererXAxis().getGridClippingRect().left;
//
//// 计算左右间距
//        int leftMargin = (int)tempChart.getRendererXAxis().getGridClippingRect().left;
//        int rightMargin = (int)(chartWidth-tempChart.getRendererXAxis().getGridClippingRect().right);
//        Logger.d("leftMargin","offset:"+leftMargin+","+rightMargin);
//
    }

    private void invalidateLineChart() {
        if (isTouchChart) {
            Logger.d("optA", "update return");
            return;
        }
//        isUpdatingChart = true;
        mArrow.invalidate();
        mChart.invalidate();
        intensityChart.invalidate();
    }

    int[] dvs;
    SendOrderEvent lastDvsData;
    SendOrderEvent preDvsData;
    LineDataSet otdrData;

    private void refreshData() {
        if (lastDvsData == null) {
            return;
        }
        dvs = lastDvsData.getDvs();

        fillWaterfallChart(dvs);

        ArrayList<Entry> yVals = new ArrayList<>();
        for (int i = 0; i < dvs.length; i++) {
            float xValue = (float) (ChartUtil.dvsIndexToDistance(i));
            if (xValue >= 0) {
                yVals.add(new Entry(xValue, dvs[i]));
            }
        }

        //这个再光缆故障检测中以前不都是用dvs长度展示的么，上次修改成OTDR测量多少展示多少，后面空的就行，现在光缆故障检测页面再改回去还用dvs长度为准
        oc.setMaxDistance((int) ChartUtil.dvsIndexToDistance(dvs.length - 1));

// 创建当前数据集
        LineDataSet currentDataSet = new LineDataSet(yVals, "");
        currentDataSet.setCubicIntensity(0.2f);
        currentDataSet.setDrawFilled(false);
        currentDataSet.setDrawCircles(false);
        currentDataSet.setDrawValues(false);
        currentDataSet.setLineWidth(2f);
        currentDataSet.setHighLightColor(Color.rgb(244, 117, 117));
        currentDataSet.setColor(Color.BLUE);

// 创建数据对象
        LineChart tempChart = mChart;

        tempChart.setDrawGridBackground(false);

        LineData tempData = null;
        if (enableYH) {
            // 处理前一数据
            int[] preDVS = preDvsData.getDvs();
            ArrayList<Entry> preYVals = new ArrayList<>();
            for (int i = 0; i < preDVS.length; i++) {
                int value = preDvsData.getDvs()[i];
                float xValue = (float) (ChartUtil.dvsIndexToDistance(i));
                if (xValue > 0) {
                    preYVals.add(new Entry(xValue, value));
                }
            }

            // 创建前一数据集
            LineDataSet preDataSet = new LineDataSet(preYVals, "Previous Data");
            preDataSet.setCubicIntensity(0.2f);
            preDataSet.setDrawFilled(false);
            preDataSet.setDrawCircles(false);
            preDataSet.setDrawValues(false);
            preDataSet.setLineWidth(2f);
            preDataSet.setColor(Color.parseColor("#00BFFF")); // 浅蓝色
            preDataSet.setHighLightColor(Color.rgb(244, 117, 117));

            // 将前一数据集与当前数据集合并
            tempData = new LineData(preDataSet, currentDataSet);
//            LineData combinedData = new LineData(preDataSet, currentDataSet);
//            tempChart.setData(combinedData);
        } else {
            tempData = new LineData(currentDataSet);
//            LineData data = new LineData(currentDataSet);
//            tempChart.setData(data);
        }

        // 实时寻峰线
        tempChart.getXAxis().removeAllLimitLines();
        tempChart.getAxisLeft().removeAllLimitLines();
        tempChart.getAxisRight().removeAllLimitLines();
        if (enableRX) {
            if (dvs.length > 0) {
                float lowestVisibleX = tempChart.getLowestVisibleX();
                float highestVisibleX = tempChart.getHighestVisibleX();
                // Find max value and its index
                int maxIndex = Integer.MIN_VALUE;
                int maxValue = dvs[0];
                for (int i = 1; i < dvs.length; i++) {
                    float tempX = ChartUtil.dvsIndexToDistance(i);
                    //在折线图范围内进行寻峰
                    if (tempX >= lowestVisibleX && tempX <= highestVisibleX) {
                        if (dvs[i] > maxValue) {
                            maxValue = dvs[i];
                            maxIndex = i;
                        }
                    }
                }
                float maxX = ChartUtil.dvsIndexToDistance(maxIndex);
                if (Integer.parseInt(mOpticalTestHelper.getCurrentSjzu()) > maxValue || maxIndex == Integer.MIN_VALUE) {
//                    mArrow.setArrowParams(0, 0, 0, 0);
                    drawVerticalLine(lastMax, Color.BLACK, "最大值"); // Draw red vertical line at max value
                    float fixedX = mEndEventStartDistance; // Fixed x coordinate for the second line
                    drawVerticalLine(fixedX, Color.BLACK, "事件点"); // Draw dark red vertical line at 20000
                    //绘制箭头
                    mArrow.setArrowParams(lowestVisibleX, highestVisibleX, lastMax, fixedX);
                } else {
                    lastMax = maxX;
                    drawVerticalLine(maxX, Color.BLACK, "最大值"); // Draw red vertical line at max value
                    float fixedX = mEndEventStartDistance; // Fixed x coordinate for the second line
                    drawVerticalLine(fixedX, Color.BLACK, "事件点"); // Draw dark red vertical line at 20000
                    //绘制箭头
                    mArrow.setArrowParams(lowestVisibleX, highestVisibleX, maxX, fixedX);
                }
            }
        } else {
            mArrow.setArrowParams(0, 0, 0, 0);
        }


        if (mDisOTDRData != null && mDisOTDRData.size() > 0 && otdrVisible) {
            if (changeOTDRData) {
                List<double[]> disOTDRData = mDisOTDRData;

                ArrayList<Entry> yVals2 = new ArrayList<>();
                for (int i = 0; i < disOTDRData.size(); i++) {
                    double[] dataPoint = disOTDRData.get(i);
                    float x = (float) dataPoint[0]; // Assuming the same x values
                    yVals2.add(new Entry(x, (float) dataPoint[1])); // Assuming the second value is y
                }

                // 设置第二个数据集的属性
                LineDataSet set2 = new LineDataSet(yVals2, "Second Data Set");
                set2.setCubicIntensity(0.2f);
                set2.setDrawFilled(false);
                set2.setDrawCircles(false);
                set2.setDrawValues(false);
                set2.setLineWidth(2f);
                set2.setCircleSize(5f);
                set2.setHighLightColor(Color.rgb(117, 244, 117)); // 不同的高亮颜色
                set2.setColor(Color.RED); // 不同的线条颜色‘
                otdrData = set2;

// 设置第二个 y 轴的显示属性
                YAxis rightAxis = tempChart.getAxisRight();
                rightAxis.setEnabled(true); // 确保右侧 y 轴启用
//                rightAxis.setDrawGridLines(false); // 不绘制网格线
//                rightAxis.setDrawLabels(false);

                // 将第二个数据集与右侧 y 轴关联
                otdrData.setAxisDependency(YAxis.AxisDependency.RIGHT);
            }

// 创建或更新 LineData，使用第二个数据集关联右侧 y 轴
//            LineData data2 = tempChart.getData();
//            if (data2 != null) {
//                data2.addDataSet(otdrData);
//            } else {
//                data2 = new LineData(otdrData);
//            }
            // 更新图表数据
//            tempChart.setData(data2);
            if (tempData != null) {
                tempData.addDataSet(otdrData);
            } else {
                tempData = new LineData(otdrData);
            }
        }
        if (tempData != null) {
            tempChart.setData(tempData);

            ViewPortHandler handler = tempChart.getViewPortHandler();
            handler.setMinimumScaleY(0.01f); // 最小缩放倍数（最多放大）
            handler.setMaximumScaleY(100f);   // 最大缩放倍数（最多缩小）
        }
    }

    private float lastMax = 0f;


    private void drawVerticalLine(float x, int color, String lable) {
        // Implement drawing vertical line logic on chart
        // Example:
        LineChart tempChart = mChart;

        LimitLine limitLine = new LimitLine(x, lable); // Optional label
        limitLine.setLineColor(color);
        limitLine.setLineWidth(2f);
        //实时寻峰加一个偏移
        limitLine.setLabelPosition(LimitLine.LimitLabelPosition.RIGHT_TOP);
        DashPathEffect dashPathEffect = new DashPathEffect(new float[]{10f, 5f}, 0);
        limitLine.enableDashedLine(10f, 5f, 0); // 设置虚线的效果
        tempChart.getXAxis().addLimitLine(limitLine);
    }

    List<double[]> mDisOTDRData;
    boolean changeOTDRData = false;

    @Override
    public void responseToUser(String mlsj, float pointDistance, int maxDistance) {
        if (isUser()) {
            //如果当前的app是用户端
            //应该不用管了直接显示就好了吧

        } else {
            //如果当前的ap是设备端
            //需要把这个otdr的数据传到用户端
            SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandOTDRDataResponse), new Gson().toJson(new OtdrOriangeBean(mlsj, pointDistance, maxDistance)));
        }

        try {
            if ((BuildConfig.DEBUG || isDebugData) && isFirstCopy) {
                isFirstCopy = false;

                ClipboardUtils.copyText(" " + pointDistance + " " + maxDistance + "   " + "  " + mlsj.length() + "  " + mlsj.substring(0, 100));
            }
        } catch (Exception e) {

        }
    }

    @Override
    public void OnOTDRData(List<double[]> disOTDRData) {
        Logger.d("mDisOTDRData", "get otdr data");
        mDisOTDRData = disOTDRData;
        changeOTDRData = true;
        runOnUiThread(new Runnable() {
            @Override
            public void run() {
                if (isDestroy) {
                    return;
                }
                if (!runningState) {
                    refreshData();
                    invalidateLineChart();
                }
            }
        });

    }

    boolean isFirstCopy = true;

    public static List<String> splitString(String str, int length) {
        List<String> result = new ArrayList<>();
        for (int i = 0; i < str.length(); i += length) {
            int end = Math.min(i + length, str.length());
            result.add(str.substring(i, end));
        }
        return result;
    }

    public static int hexToInt16Signed(byte[] bytes) {
        // 将十六进制字符串转换为无符号的整数
        int num = uint16ToInt(bytes, 0);

        // 检查最高位（符号位）
        if ((num & 0x8000) != 0) {
            // 如果最高位是1，则是有符号整数的负数
            // 使用位运算将其转换为正数（取反加一）
            num = -(0xFFFF - num + 1);
        }

        // 返回绝对值（在这个情况下，因为我们已经处理了负数，所以直接返回即可）
        return Math.abs(num);
    }

    public static int uint16ToInt(byte[] data, int offset) {
        return (data[offset] & 0xFF) << 8 | (data[offset + 1] & 0xFF);
    }

//    Handler handlerSend = new Handler(new Handler.Callback() {
//        @Override
//        public boolean handleMessage(Message msg) {
//
//            if (msg.what < serorder.size()) {
//                sendSerialData2(ByteUtil.hexStr2bytes(serorder.get(msg.what)));
//                handlerSend.sendEmptyMessageDelayed(msg.what + 1, 2000);
//            } else {
//                handlerSend.removeCallbacksAndMessages(null);
//            }
//
//            return false;
//        }
//    });


    private void initDevice() {
        oc.setSender(this);
    }

    @Override
    public void SendSerStr(String str) {
        sendSerialData2(ByteUtil.hexStr2bytes(str));
    }

    private void sendSerialData2(byte[] data) {
        Logger.d("sheng", "send ser 2:" + ByteUtil.bytes2HexStr(data));
        try {
            SerialPortManager2.instance().sendData(data);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    String getwayorder = "";

    @Subscribe
    public void onEventMainThread(SendOrderEvent event) {
//        Logger.d("FirFilters", "张量解析数据，onEventMainThread="+event.getDvs().length);
        if (event.getDvs().length == CustomSetting.getDvsPointNum()) {
            long currentTime = System.currentTimeMillis();

            // 节流逻辑
            if (currentTime - lastEventTime < EVENT_DELAY) {
                return; // 如果未达到节流时间，直接返回
            }
            lastEventTime = currentTime; // 更新事件时间

            processDvsData(event);
        }
    }

    private void processDvsData(SendOrderEvent event) {
        executorService.submit(() -> {
            try {
                if (isDestroy) {
                    return;
                }
                notifyDataChanged(event);
            } catch (Exception e) {
                e.printStackTrace();
            }
        });
    }


    @Subscribe
    public void onEventMainThread(GetSerialMessageEvent event) {
        if (event.device.equals(mDevicename2)) {
            oc.receive(event.data);
        }
    }


    long lastClickOtdrTime = 0; // 上一次点击的时间
    long lastClickFilterTime = 0; // 上一次点击的时间

    @Override
    protected void registerListener() {
        holder.setOnClickListener(R.id.back, v -> {
            finish();
        });
        holder.setOnClickListener(R.id.way, v -> {
            if (isTouchChart) {
                return;
            }

            long currentTime = System.currentTimeMillis();
            if (currentTime - lastClickOtdrTime < OTDR_DELAY) {
                int time = (int) ((OTDR_DELAY - currentTime + lastClickOtdrTime) / 1000);
                ToastUtils.showShort("OTDR功能正在使用中，请" + time + "s后再试！");
                return;
            }
            // 检查是否距离上次点击超过 100ms
            if (currentTime - lastClickTime > 300) {
                lastClickTime = currentTime; // 更新上次点击时间
                //第一个数据未到达前，不可操作
                if (!firstDataArrive && !isUser() && !BuildConfig.DEBUG) {
                    Toast.makeText(v.getContext(), "尚未启动!", Toast.LENGTH_SHORT).show();
                    return;
                }
                if (runningState) {
                    holder.setActivated(R.id.way, true);
                    stopDVS(false);
                    Toast.makeText(v.getContext(), "已停止!", Toast.LENGTH_SHORT).show();
                    imagewater.setClickable(true);
                    runningState = false;
                } else {
                    holder.setActivated(R.id.way, false);
                    startDVS(false);
                    Toast.makeText(v.getContext(), "已启动!", Toast.LENGTH_SHORT).show();
                    imagewater.setClickable(false);
                    runningState = true;
                }
            }

        });
        holder.setOnClickListener(R.id.yuhui, v -> {
            if (isTouchChart) {
                return;
            }
            boolean activated = holder.getActivated(R.id.yuhui);
            if (activated) {
                enableYH = true;
            } else {
                enableYH = false;
            }

            yuhui(false);
            Logger.d("sheng3", "yuhui：" + activated);
        });
        holder.setOnClickListener(R.id.otdr_start, v -> {
            realOtdrStart(false);
        });
        holder.setOnClickListener(R.id.setting, v -> {
            if (isTouchChart) {
                return;
            }
//            ToastUtils.showShort("点击了设置");
            dialogOtdr();
        });
        holder.setOnClickListener(R.id.xunfeng, v -> {
            if (isTouchChart) {
                Logger.e(TAG, "寻峰: " + isTouchChart);
                return;
            }
            if (!runningState) {
                List<RouteBean> data = imagewater.getRouteBeanList();

                if (data.isEmpty()) {
                    Toast.makeText(v.getContext(), "未选中有效点", Toast.LENGTH_SHORT).show();
                    return;
                }
                new RouteListDialog().show(mContext, data);
            }
            Logger.e(TAG, "寻峰: " + runningState);
        });
        holder.setOnClickListener(R.id.shishixunfeng, v -> {
            if (isTouchChart) {
                return;
            }
            boolean activated = holder.getActivated(R.id.shishixunfeng);
            if (!activated) {
                enableRX = false;
                holder.setActivated(R.id.shishixunfeng, !activated);
                return;
            }
            if (mEndEventStartDistance < 0) {
                ToastUtils.showShort("无事件点，无法实时寻峰！");
                return;
            }
            lastMax = 0f;
            holder.setActivated(R.id.shishixunfeng, !activated);
            ToastUtils.showShort("开始实时寻峰");

            holder.setVisible(!activated, R.id.layout_ssfz_data);
            enableRX = true;

//            loadSsxfData();
        });
        holder.setOnClickListener(R.id.shijianbiao, v -> {
            if (isTouchChart) {
                return;
            }
//            ToastUtils.showShort("点击了事件表");
            if (CommonConsts.Type == "device") {
                //设备端直接显示事件表

                showEventList(eventInfoList);
            } else {
                //用户端或者平板需要设备端发送数据
                //如果当前是用户端，需要发送指令给设备端告诉他我需要显示事件表
                ToastUtils.showShort("获取设备端事件表");
                SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandEventTable), "");
                showEventList(eventInfoList);
            }
        });
        holder.setOnClickListener(R.id.xian, v -> {
            if (isTouchChart) {
                return;
            }
            boolean activated = holder.getActivated(R.id.xian);
            if (activated) {
                otdrVisible = false;
            } else {
                otdrVisible = true;
            }
            hideOtdr(false);
        });
    }

    private void yuhui(boolean isFromServer) {
        holder.setActivated(R.id.yuhui, !enableYH);
        if (!isFromServer) {
            //人工操作
            SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandSyncYuhuiData), new Gson().toJson(new BtnStatusBean(enableYH)));
        }
    }


    private void hideOtdr(boolean isFromServer) {
        if (!runningState) {
            refreshData();
            invalidateLineChart();
        }
        holder.setActivated(R.id.xian, otdrVisible);
        if (!isFromServer) {
            //人工操作
            SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandSyncHideOtdrData), new Gson().toJson(new BtnStatusBean(otdrVisible)));
        }
    }


    /**
     * OTDR事件
     */
    private void realOtdrStart(boolean fromServer) {
        if (isTouchChart) {
            return;
        }
        long currentTime = System.currentTimeMillis();
        if (currentTime - lastClickOtdrTime > OTDR_DELAY) { // 设置防抖动时间为 20000ms
            lastClickOtdrTime = currentTime; // 更新上一次点击时间
            if (isUser()) {
                //如果当前是用户端，需要发送指令给设备端告诉他我需要启动OTDR
                if (!fromServer) {
                    OtdrBean otdrBean = new OtdrBean();
                    otdrBean.setDefaultSent(true);
                    ToastUtils.showShort("通知设备端启动OTDR!");
                    SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandOTDRDataRequest), new Gson().toJson(otdrBean));
                } else {
                    ToastUtils.showShort("设备端启动OTDR!");
                }
            } else {
                // 开启otdr的时候需要关闭dvs
                stopDVS(false);
                oc.setMaxDistance(Integer.parseInt(mOpticalTestHelper.getCurrentCjfw()));

                ChannelConsts.changeOtdrChannel(currentChannel + "");
                ToastUtils.showShort("点击了OTDR!");
                //如果当前是设备端，直接发送OTDR指令
                oc.sendOtdrStart("", 1, 0, currentZsl, ConstsOpticalData.getDefaultBc());
                if (!fromServer) {
                    OtdrBean otdrBean = new OtdrBean();
                    otdrBean.setDefaultSent(true);
                    SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandOTDRDataRequest), new Gson().toJson(otdrBean));
                } else {
                    Logger.e("TAG", "realOtdrStart: 1111111111111111");
                    SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandResponse), "设备端启动OTDR成功!");
                }
            }
        } else if (currentTime - lastClickOtdrTime > 500) {
            // 只在距离上次点击超过 500ms 时显示提示
            ToastUtils.showShort("距离上次点击OTDR未超过20s!");
        }
    }

    /**
     * OTDR事件(自定义参数)
     *
     * @return
     */
    private boolean realOtdrCustomStart(OtdrBean otdrBean) {
        try {
            currentZsl = Float.parseFloat(otdrBean.getCurrentZsl());


            mOpticalTestHelper.setDvsData(otdrBean.getCurrentSjzu(), otdrBean.getCurrentLb(), otdrBean.getCurrentMcsjDvs());
            mOpticalTestHelper.setOtdrData(otdrBean.getCurrentCjfw(), otdrBean.getCurrentMcsj(), otdrBean.getCurrentCssj(), otdrBean.getCurrentBc());


            ChartUtil.lambd = currentDVSZsl;
            ChartUtil.dividingColorValue = Integer.parseInt(mOpticalTestHelper.getCurrentSjzu());
            ChartUtil.pdjl = currentPdjl;

//            if (CustomSetting.getAddTestCsfw()) {
//                mChart.getXAxis().setAxisMaximum(Integer.parseInt(mOpticalTestHelper.getCurrentCjfw()));
//                mChart.notifyDataSetChanged();
//                mChart.invalidate();
//            }

            setExpand();
            if (isUser()) {
                //用户端通知设备端设置OTDR参数
                SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandOTDRDataRequest), new Gson().toJson(otdrBean));
                @SuppressLint("DefaultLocale") String message = String.format("通知设备端设置OTDR参数: 采集范围=%d, 脉冲宽度=%d, 测试时间=%d, 折射率=%.3f", Integer.parseInt(mOpticalTestHelper.getCurrentCjfw()), Integer.parseInt(mOpticalTestHelper.getCurrentMckd()), Integer.parseInt(mOpticalTestHelper.getCurrentCssj()), currentZsl);
                Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
            } else {
                udpTool.setModel(mOpticalTestHelper.getCurrentLb());

                //设备端需要自己设置OTDR参数
                oc.setOtdrSetWithBc(Integer.parseInt(mOpticalTestHelper.getCurrentCjfw()), Integer.parseInt(mOpticalTestHelper.getCurrentMckd()), Integer.parseInt(mOpticalTestHelper.getCurrentCssj()), currentZsl, ConstsOpticalData.getDefaultBc());
                @SuppressLint("DefaultLocale") String message = String.format("设置成功: 采集范围=%d, 脉冲宽度=%d, 测试时间=%d, 折射率=%.3f", Integer.parseInt(mOpticalTestHelper.getCurrentCjfw()), Integer.parseInt(mOpticalTestHelper.getCurrentMckd()), Integer.parseInt(mOpticalTestHelper.getCurrentCssj()), currentZsl);
                Toast.makeText(this, message, Toast.LENGTH_SHORT).show();
            }
            // 处理浮点数
            return true;
        } catch (NumberFormatException e) {
            Toast.makeText(this, "折射率输入有误，请输入有效的浮点数", Toast.LENGTH_SHORT).show();
            // 输入格式不正确的处理
            return false;
        }
    }


    //设置实时寻峰的数据
    private void loadSsxfData() {
        holder.setText(R.id.data_1, String.format("总长度：%s", "1111"));
        holder.setText(R.id.data_2, String.format("总消耗：%s", "2222"));
        holder.setText(R.id.data_3, String.format("系数：%s", "3333"));
        holder.setText(R.id.data_4, String.format("事件总数：%s", "4444"));
    }


    private long lastEventTime = 0; // 记录上一个事件的时间
    private static final long EVENT_DELAY = 240; // 事件节流时间
    private ExecutorService executorService = Executors.newSingleThreadExecutor();
    private ExecutorService executorParseDvsData = Executors.newSingleThreadExecutor();
    private ExecutorService executorParseOtdrData = Executors.newSingleThreadExecutor();


    private void dialogOtdr() {
        NoticeDialog dialog = new NoticeDialog.Builder(holder.mContext).setLayoutId(R.layout.dialog_otdr).setClickBtnDismissDialog(false).setCanceledOnTouchOutside(false).create();

        dialog.setDialogWith(0, ScreenUtils.getScreenHeight());
        dialog.setGravity(Gravity.END);


        dialog.show();


        otdrEvent(dialog);
        //选择otdr
        dialog.getView(R.id.otdr).performClick();
    }


    private void loadOtdrData(NoticeDialog dialog) {

        // 设置已选中的测试时间
        // 设置已选中的测试时间
        dialog.setText(R.id.content_zsl, "" + currentZsl);

//        dialog.setText(R.id.content_cssj, "3333");
//        dialog.setText(R.id.content_bxss, "555");
//        dialog.setText(R.id.content_shdyz, "666");
//        dialog.setText(R.id.content_fsfyz, "7777");
//        dialog.setText(R.id.content_zdsbyz, "888");


        //dvs设置的值
        dialog.setText(R.id.content_zsl_dvs, "" + currentDVSZsl);
        dialog.setText(R.id.content_pdjl_dvs, "" + currentPdjl);
//        dialog.setText(R.id.content_lb_dvs, "" + udpTool.getModel());
    }

    @Override
    public void OnEventList(List<Map<String, Object>> eventList) {
        final String sjxh = "事件序号"; // 事件序号  （N）uint32
        final String sjlx = "事件类型"; // 事件类型       uint32

        // 清空 eventInfoList，以防止重复添加
        eventInfoList.clear();
        float fdshTotla = 0f;
        // 遍历 eventList，读取 sjxh 和 sjlx，创建 EventInfo 对象
        for (Map<String, Object> event : eventList) {
            String eventNumber = String.valueOf(event.get(sjxh)); // 获取事件序号
            String eventType = String.valueOf(getSjlxName(event.get(sjlx))); // 获取事件类型
//            int distance = ((int) (((float) event.get("起始距离")) * 1000));
            float distance = (float) event.get("起始距离");
            float crsh = checkData((float) event.get("插入损耗"));
            float fdsh = checkData((float) event.get("分段衰耗"));
            float hbsh = checkData((float) event.get("回波损耗"));
            fdshTotla += checkData(fdsh);
            float distanceTottal = 0f;
            if (eventType.equals("结尾事件")) {
                mEndEventStartDistance = distance;
                distanceTottal = checkData((float) event.get("结束距离"));

                Logger.d("OtdrEvent", "end distance:" + mEndEventStartDistance);
            }
            eventInfoList.add(new EventInfo(eventNumber, eventType, distance, crsh, fdsh, hbsh, fdshTotla, distanceTottal)); // 创建并添加 EventInfo 对象
        }

        if (!isUser()) {
            //要一直响应
            SocketHelper.sendCommand(SendCommand.commandToStr(SendCommand.commandSsxfResponseOperate), new Gson().toJson(new SsxfBean(mEndEventStartDistance)));
        }
    }

    private float checkData(float f) {
        if (Float.isNaN(f) || Float.isInfinite(f)) {
            f = 0f; // 替换为默认值
        }
        return f;
    }

    public static String getSjlxName(Object sjlx) {
        if (Objects.equals(1, sjlx)) return "起始事件";
        if (Objects.equals(2, sjlx)) return "结尾事件";
        if (Objects.equals(3, sjlx)) return "反射事件";
        if (Objects.equals(4, sjlx)) return "非反射事件";
        return null;
    }


    private void clickSave() {
        if (SocketHelper.isUserOnline() && !isUser()) {
            ToastUtils.showShort("用户端正在操作，暂时无法设置参数");
            return;
        }
        OtdrBean otdrBean = mOpticalTestHelper.getDataBean();
        otdrBean.setCurrentZsl(currentZsl + "");

        otdrBean.setCurrentDVSZsl(currentDVSZsl + "");
        otdrBean.setCurrentPdjl(currentPdjl + "");
//        if (CustomSetting.getAddTestCsfw()) {
//            mChart.getXAxis().setAxisMaximum(Integer.parseInt(mOpticalTestHelper.getCurrentCjfw()));
//            mChart.notifyDataSetChanged();
//            mChart.invalidate();
//        }
        realOtdrCustomStart(otdrBean);
    }

    private void otdrEvent(NoticeDialog dialog) {
        dialog.setOnclickListener(R.id.sure, v -> {
            if (SocketHelper.isUserOnline() && !isUser()) {
                ToastUtils.showShort("用户端正在操作，暂时无法设置参数");
                return;
            }
            //OTDR的折射率
            String zsl = ((EditText) dialog.findViewById(R.id.content_zsl)).getText().toString();
            //DVS的折射率
            String dvsZSL = ((EditText) dialog.findViewById(R.id.content_zsl_dvs)).getText().toString();
            //DVS的抛点距离
            String pdjl = ((EditText) dialog.findViewById(R.id.content_pdjl_dvs)).getText().toString();


            OtdrBean otdrBean = mOpticalTestHelper.getDataBean();
            otdrBean.setCurrentZsl(zsl);
            //            dvs数据
            otdrBean.setCurrentDVSZsl(dvsZSL);
            otdrBean.setCurrentPdjl(pdjl);

//            if (CustomSetting.getAddTestCsfw()) {
//                mChart.getXAxis().setAxisMaximum(Integer.parseInt(mOpticalTestHelper.getCurrentCjfw()));
//                mChart.notifyDataSetChanged();
//                mChart.invalidate();
//            }
            if (realOtdrCustomStart(otdrBean)) {
                dialog.dismiss();
            }
        });
        ((RadioGroup) dialog.getViewT(R.id.layout_btn)).setOnCheckedChangeListener((radioGroup, i) -> {
            switch (i) {
                case R.id.otdr:
                    dialog.setVisibility(R.id.layout_otdr, View.VISIBLE);
                    dialog.setVisibility(R.id.layout_dvs, View.GONE);
                    break;
                case R.id.dvs:
                    dialog.setVisibility(R.id.layout_otdr, View.GONE);
                    dialog.setVisibility(R.id.layout_dvs, View.VISIBLE);
                    break;
            }
            loadOtdrData(dialog);
        });
        dialog.setOnclickListener(R.id.close, v -> {
            ToastUtils.showShort("退出");
            dialog.dismiss();
        });
    }


    NoticeDialog dialogEventTable;

    private void showEventList(List<EventInfo> list) {
        if (BuildConfig.DEBUG && list.isEmpty()) {
            list.add(new EventInfo("1", "测试事件1", 100, 1f, 1f, 1f, 1f));
        }
        if (dialogEventTable == null) {
            dialogEventTable = new NoticeDialog.Builder(holder.mContext).setLayoutId(R.layout.dialog_event_list).setClickBtnDismissDialog(true).setCanCancel(true).setCanceledOnTouchOutside(true).create();
            dialogEventTable.setOnclickListener(R.id.close, v -> {
                dialogEventTable.dismiss();
            });
            dialogEventTable.setGravity(Gravity.CENTER);
        }

        if (!dialogEventTable.isShowing()) {
            dialogEventTable.show();
        }

        LinearLayout layoutEvent = (LinearLayout) dialogEventTable.getView(R.id.layout_event_list);
        renderEventTable(true, layoutEvent, list);
    }

    @Override
    protected void onResume() {
        super.onResume();
        locationHelper.start();
    }

    private ScaleGestureDetector scaleGestureDetector;


    //初始化图表
    private void initChat() {

        LineChart tempChart = mChart;
        tempChart.setGridBackgroundColor(Color.rgb(255, 255, 255));

        tempChart.setExtraOffsets(10f, 0f, 10f, 15f);
        tempChart.setTouchEnabled(true);
        //设置是否可以拖拽，缩放
        tempChart.setDragEnabled(true);
        tempChart.setScaleEnabled(false);
        //设置是否能扩大扩小
        tempChart.setScaleYEnabled(true);
        tempChart.setScaleXEnabled(true);
        tempChart.setPinchZoom(false);

        tempChart.setDrawBorders(false);
        tempChart.getAxisRight().setDrawGridLines(false);
        YAxis left = tempChart.getAxisLeft();
        left.setDrawGridLines(true);
        left.enableGridDashedLine(10f, 5f, 0);
//        tempChart.getAxisLeft().setDrawLabels(false);
        XAxis xAxis = tempChart.getXAxis();
        xAxis.setDrawGridLines(true);
        xAxis.enableGridDashedLine(10f, 5f, 0);


        tempChart.getDescription().setEnabled(false);

        tempChart.setDrawGridBackground(false);
        XAxis xl = tempChart.getXAxis();


        float textSize = 17f;
        Typeface tf = Typeface.DEFAULT_BOLD;

        xl.setPosition(XAxis.XAxisPosition.BOTTOM); // 设置X轴的数据在底部显示
        xl.setTextSize(textSize); // 设置字体大小
        xl.setTypeface(tf);
        xl.setTextColor(Color.BLACK);

        YAxis yl = tempChart.getAxisLeft();
        yl.setPosition(YAxis.YAxisLabelPosition.OUTSIDE_CHART);

        yl.setTextSize(textSize); // s设置字体大小
        yl.setTypeface(tf);
        yl.setAxisMinValue(90f);
        yl.setStartAtZero(false);
        yl.setAxisLineWidth(0);
        yl.setTextColor(Color.BLACK);

        YAxis y2 = tempChart.getAxisRight();
        y2.setPosition(YAxis.YAxisLabelPosition.OUTSIDE_CHART);
        y2.setTextSize(textSize); // s设置字体大小
        y2.setTypeface(tf);
        y2.setStartAtZero(true);
        y2.setAxisLineWidth(0);
        y2.setTextColor(Color.BLACK);

//        yl.setValueFormatter(new ValueFormatter() {
//            @Override
//            public String getFormattedValue(float value) {
//                // 只保留能整除 0.1 的数
//                if (value * 10 % 1 == 0) {
//                    return String.format("%.1f", value);
//                } else {
//                    return ""; // 不显示这个刻度
//                }
//            }
//        });


        tempChart.getAxisLeft().setAxisMinimum(0f);
        tempChart.getAxisLeft().setAxisMaximum(300f);

        tempChart.getAxisRight().setAxisMinimum(0f);
        tempChart.getAxisRight().setAxisMaximum(45f);
        tempChart.getAxisRight().setLabelCount(6, true); // 第二个参数设为 true 表示“强制等距划分，包含最大值”


        ChartUtil.lambd = currentDVSZsl;
        ChartUtil.dividingColorValue = Integer.parseInt(mOpticalTestHelper.getCurrentSjzu());
        ChartUtil.pdjl = currentPdjl;
        this.scaleGestureDetector = new ScaleGestureDetector(mContext, new ScaleGestureDetector.SimpleOnScaleGestureListener() {

            @Override
            public boolean onScale(ScaleGestureDetector detector) {
                float currentSpanX = detector.getCurrentSpanX();
                float currentSpanY = detector.getCurrentSpanY();
                float prevSpanX = detector.getPreviousSpanX();
                float prevSpanY = detector.getPreviousSpanY();

                float deltaX = Math.abs(currentSpanX - prevSpanX);
                float deltaY = Math.abs(currentSpanY - prevSpanY);

                float scaleFactor = detector.getScaleFactor();
                float focusX = detector.getFocusX();
                float focusY = detector.getFocusY();

                if (deltaX > deltaY) {
                    // 横向缩放 X 轴
                    tempChart.getViewPortHandler().refresh(
                            tempChart.getViewPortHandler().zoom(scaleFactor, 1f, focusX, focusY),
                            tempChart,
                            true
                    );
                } else {
                    // 纵向缩放 Y 轴
                    tempChart.getViewPortHandler().refresh(
                            tempChart.getViewPortHandler().zoom(1f, scaleFactor, focusX, focusY),
                            tempChart,
                            true
                    );
                }

                tempChart.invalidate();
                return true;
            }
        });
        tempChart.setOnTouchListener(new View.OnTouchListener() {
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                scaleGestureDetector.onTouchEvent(event);
                // 转发给原始图表触摸监听，保留拖动、高亮、点击等事件
                return tempChart.onTouchEvent(event);
            }
        });
        tempChart.setOnChartValueSelectedListener(new OnChartValueSelectedListener() {
            @Override
            public void onValueSelected(Entry entry, Highlight highlight) {

                float x = entry.getX(); // 获取X轴的值
                touchpoint = x;
                fillIntensityChart(x, true);
                if (!runningState) {
                    intensityChart.invalidate();
                }
                currentHighlightBean = new HighlightBean(highlight.getX(), highlight.getY(), highlight.getDataSetIndex());
                Logger.e("TAG", "onValueSelected: ===================" + entry.getX() + "  " + entry.getY() + "   " + highlight.toString());
                return;
            }

            @Override
            public void onNothingSelected() {
                Logger.e("TAG", "onNothingSelected: ===================");

            }
        });

        tempChart.setOnChartGestureListener(new OnChartGestureListener() {
            private Handler handler = new Handler();
            private Runnable longPressRunnable;
            private boolean isLongPressed = false;

            @Override
            public void onChartGestureStart(MotionEvent me, ChartTouchListener.ChartGesture lastPerformedGesture) {
                Logger.e("oye", "onChartGestureStart");
                isTouchChart = true;

                // 开始新的手势时，重置长按状态
                isLongPressed = false;
//                    isUserOperateLine = false;
// 取消可见范围的限制，允许自由缩放
                mChart.setVisibleXRangeMaximum(Float.MAX_VALUE);
                mChart.setVisibleXRangeMinimum(1);
//                    mChart.setVisibleXRange(10, Float.MAX_VALUE);
//                    mChart.fitScreen();
                mChart.invalidate();

                // 设置长按事件的触发时间（例如700毫秒）
                longPressRunnable = () -> {
                    isLongPressed = true;
                    onChartLongPressed(me); // 自定义的长按处理
                };
                handler.postDelayed(longPressRunnable, 3000); // 长按延时700ms
            }

            @Override
            public void onChartGestureEnd(MotionEvent me, ChartTouchListener.ChartGesture lastPerformedGesture) {
                setBitmap();
                isTouchChart = false;
                isLongPressed = false;
                handler.removeCallbacks(longPressRunnable);


                try {
                    //设备端才需要把这个数据发生变化发送给服务器
                    if (isUser()) {
                        float startX = tempChart.getLowestVisibleX();
                        float endX = tempChart.getHighestVisibleX();
                        // 获取Y轴范围（推荐用这种）
                        MPPointD topLeft = tempChart.getValuesByTouchPoint(tempChart.getViewPortHandler().contentLeft(), tempChart.getViewPortHandler().contentTop(), YAxis.AxisDependency.LEFT);
                        MPPointD bottomRight = tempChart.getValuesByTouchPoint(tempChart.getViewPortHandler().contentRight(), tempChart.getViewPortHandler().contentBottom(), YAxis.AxisDependency.LEFT);

                        float minY = (float) topLeft.y;
                        float maxY = (float) bottomRight.y;
                        ChartControlBean bean = new ChartControlBean(startX, endX, minY, maxY, tempChart.getScaleX(), tempChart.getScaleY());
                        SocketHelper.sendCommand(SendCommand.commandMatrixResponse, new Gson().toJson(bean));
                    }

                    if (currentHighlightBean != null) {
                        SocketHelper.sendCommand(SendCommand.commandSyncLineData, new Gson().toJson(currentHighlightBean));
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                }

            }

            @Override
            public void onChartLongPressed(MotionEvent me) {
                if (isLongPressed) {
                    mChart.fitScreen();
                }
            }

            @Override
            public void onChartDoubleTapped(MotionEvent me) {

            }

            @Override
            public void onChartSingleTapped(MotionEvent me) {

            }

            @Override
            public void onChartFling(MotionEvent me1, MotionEvent me2, float velocityX, float velocityY) {

            }

            @Override
            public void onChartScale(MotionEvent me, float scaleX, float scaleY) {
//                try {
//                    //设备端才需要把这个数据发生变化发送给服务器
//                    if (isUser()) {
//                        // 获取当前的缩放和偏移信息
//                        Matrix matrix = tempChart.getViewPortHandler().getMatrixTouch();
//                        float[] values = new float[9];
//                        matrix.getValues(values);
//
//
//                        float startX = tempChart.getLowestVisibleX();
//                        float endX = tempChart.getHighestVisibleX();
//
//                        ChartControlBean bean = new ChartControlBean(startX, endX);
//
//                        SocketHelper.sendCommand(SendCommand.commandMatrixResponse, new Gson().toJson(bean));
//                    }
//                } catch (Exception e) {
//                    e.printStackTrace();
//                }
            }

            @Override
            public void onChartTranslate(MotionEvent me, float dX, float dY) {

            }
        });
    }

    HighlightBean currentHighlightBean;


    private void renderEventTable(boolean isDialog, LinearLayout layoutEvent, List<EventInfo> list) {

        if (BuildConfig.DEBUG && list.isEmpty()) {
            list.add(new EventInfo("1", "测试事件1", 100, 1f, 1f, 1f, 1f));
        }
        layoutEvent.removeAllViews();
        for (EventInfo eventInfo : list) {

            int resId = R.layout.item_event_info;
            if (!isDialog) {
                resId = R.layout.item_event_info_otdr;
            }
            View view = LayoutInflater.from(holder.mContext).inflate(resId, null);
            ((TextView) view.findViewById(R.id.number)).setText(eventInfo.getEventId());
            ((TextView) view.findViewById(R.id.type)).setText(eventInfo.getEventType());
            ((TextView) view.findViewById(R.id.distance)).setText(eventInfo.getStartDistance() + "");
            ((TextView) view.findViewById(R.id.sh)).setText(eventInfo.getCrsh() + "");
            ((TextView) view.findViewById(R.id.shuaihao)).setText(eventInfo.getFdsh() + "");
            ((TextView) view.findViewById(R.id.fs)).setText(eventInfo.getHbsh() + "");
            ((TextView) view.findViewById(R.id.zsh)).setText(eventInfo.getFdshTotla() + "");


            float startDistatce = eventInfo.getStartDistance();
            String eId = eventInfo.getEventId();
            layoutEvent.addView(view);
            view.setOnClickListener(v -> {
                mEndEventStartDistance = startDistatce;
                ToastUtils.showShort("已选中事件:" + eId + ",距离为:" + startDistatce);
            });
        }
    }
}
